<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Admin\Scene\Service\Spot;
use App\Setting;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class ListenerController extends Controller
{
    private $viewPrefix = 'web.listener.';
    private $routePrefix = 'listener';
    public function index($id){
        $user = Auth::user();
        $audition_id = Setting::getConfig('sceneId');
        if($audition_id==$id){
            $model = new Spot();
            $scenic = $model->getSpot($audition_id);
            if($scenic){
                if($scenic->status!=Spot::OFF){
                    return $this->commonMsgWap('success','该景点已下架',1);
                }
            }else{
                return $this->commonMsgWap('success','该景点已不存在',1);

            }
        }
    }
    public function audition(){
        $audition_id = Setting::getConfig('sceneId');
        return view($this->viewPrefix.'audition',[
            'audition_id'   => $audition_id,
            'routePre'  => $this->routePrefix
        ]);
    }
}
